home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / jcool01.zip / NT_STATE.H < prev    next >
C/C++ Source or Header  |  1992-08-20  |  2KB  |  53 lines

  1. //
  2. // Copyright (C) 1991 Texas Instruments Incorporated.
  3. //
  4. // Permission is granted to any individual or institution to use, copy, modify,
  5. // and distribute this software, provided that this complete copyright and
  6. // permission notice is maintained, intact, in all copies and supporting
  7. // documentation.
  8. //
  9. // Texas Instruments Incorporated provides this software "as is" without
  10. // express or implied warranty.
  11. //
  12. // Updated: VDN 02/21/92 -- Separate NT_State which must be implemented once
  13. // Updated: JAM 08/19/92 -- modernized template syntax, remove macro hacks
  14. //
  15.  
  16.  
  17. #ifndef N_TREE_STATEH                // If no definition for class
  18. #define N_TREE_STATEH
  19.  
  20. #ifndef STACKH                    // If no definition for class
  21. #include <cool/Stack.h>                // include definition file
  22. #endif
  23.  
  24. #ifndef PAIRH                    // If no definition for class
  25. #include <cool/Pair.h>                // include definition file
  26. #endif
  27.  
  28. typedef CoolPair<long,int> CoolNT_Stack_Entry;
  29. typedef CoolStack< CoolPair<long,int> > CoolNT_Stack;
  30.  
  31.  
  32. // Simple class that bundles an iterator stack with the direction 
  33. // of the traversal (forward or backward).  This is the current_position
  34. // state that can be saved and restored 
  35.  
  36. class CoolNT_State {                // State bundles Stack&Boolean
  37. public:
  38.   inline CoolNT_State () {};            // Simple constructor
  39.   CoolNT_State (const CoolNT_State& s);        // Copy constructor
  40.   inline ~CoolNT_State () {};            // Destructor
  41.   
  42.   CoolNT_State& operator= (const CoolNT_State& s); // overload = operator
  43.  
  44.   CoolNT_Stack stack;                // should be protected
  45.   Boolean forward;
  46. };
  47.  
  48. #endif                        // N_TREE_STATEH
  49.  
  50.  
  51.  
  52.  
  53.